| | | 1 | | // Copyright (c) 2020-2023 dotBunny Inc. |
| | | 2 | | // dotBunny licenses this file to you under the BSL-1.0 license. |
| | | 3 | | // See the LICENSE file in the project root for more information. |
| | | 4 | | |
| | | 5 | | using System; |
| | | 6 | | using GDX.Collections; |
| | | 7 | | using UnityEngine; |
| | | 8 | | |
| | | 9 | | namespace GDX.Data |
| | | 10 | | { |
| | | 11 | | [Serializable] |
| | | 12 | | public class SimpleTable : ScriptableObject |
| | | 13 | | { |
| | | 14 | | public enum ColumnType |
| | | 15 | | { |
| | | 16 | | Invalid = -1, |
| | | 17 | | String, |
| | | 18 | | Char, |
| | | 19 | | Bool, |
| | | 20 | | Sbyte, |
| | | 21 | | Byte, |
| | | 22 | | Short, |
| | | 23 | | Ushort, |
| | | 24 | | Int, |
| | | 25 | | Uint, |
| | | 26 | | Long, |
| | | 27 | | Ulong, |
| | | 28 | | Float, |
| | | 29 | | Double, |
| | | 30 | | Vector2, |
| | | 31 | | Vector3, |
| | | 32 | | Vector4, |
| | | 33 | | Vector2Int, |
| | | 34 | | Vector3Int, |
| | | 35 | | Quaternion, |
| | | 36 | | Rect, |
| | | 37 | | RectInt, |
| | | 38 | | Color, |
| | | 39 | | LayerMask, |
| | | 40 | | Bounds, |
| | | 41 | | BoundsInt, |
| | | 42 | | Hash128, |
| | | 43 | | Gradient, |
| | | 44 | | AnimationCurve, |
| | | 45 | | Object, |
| | | 46 | | Count |
| | | 47 | | } |
| | | 48 | | |
| | | 49 | | [Serializable] |
| | | 50 | | public struct ColumnEntry |
| | | 51 | | { |
| | | 52 | | public string Name; |
| | | 53 | | public int Id; |
| | | 54 | | public ColumnType Type; |
| | | 55 | | } |
| | | 56 | | |
| | | 57 | | [Serializable] |
| | | 58 | | internal struct ColumnEntryInternal |
| | | 59 | | { |
| | | 60 | | public ColumnType columnType; |
| | | 61 | | public int columnDenseIndex; |
| | | 62 | | } |
| | | 63 | | |
| | | 64 | | |
| | | 65 | | |
| | | 66 | | |
| | | 67 | | [SerializeField] internal ArrayHolder<string>[] allStringColumns; |
| | | 68 | | [SerializeField] internal ArrayHolder<bool>[] allBoolColumns; |
| | | 69 | | [SerializeField] internal ArrayHolder<char>[] allCharColumns; |
| | | 70 | | [SerializeField] internal ArrayHolder<sbyte>[] allSbyteColumns; |
| | | 71 | | [SerializeField] internal ArrayHolder<byte>[] allByteColumns; |
| | | 72 | | [SerializeField] internal ArrayHolder<short>[] allShortColumns; |
| | | 73 | | [SerializeField] internal ArrayHolder<ushort>[] allUshortColumns; |
| | | 74 | | [SerializeField] internal ArrayHolder<int>[] allIntColumns; |
| | | 75 | | [SerializeField] internal ArrayHolder<uint>[] allUintColumns; |
| | | 76 | | [SerializeField] internal ArrayHolder<long>[] allLongColumns; |
| | | 77 | | [SerializeField] internal ArrayHolder<ulong>[] allUlongColumns; |
| | | 78 | | [SerializeField] internal ArrayHolder<float>[] allFloatColumns; |
| | | 79 | | [SerializeField] internal ArrayHolder<double>[] allDoubleColumns; |
| | | 80 | | [SerializeField] internal ArrayHolder<Vector2>[] allVector2Columns; |
| | | 81 | | [SerializeField] internal ArrayHolder<Vector3>[] allVector3Columns; |
| | | 82 | | [SerializeField] internal ArrayHolder<Vector4>[] allVector4Columns; |
| | | 83 | | [SerializeField] internal ArrayHolder<Vector2Int>[] allVector2IntColumns; |
| | | 84 | | [SerializeField] internal ArrayHolder<Vector3Int>[] allVector3IntColumns; |
| | | 85 | | [SerializeField] internal ArrayHolder<Quaternion>[] allQuaternionColumns; |
| | | 86 | | [SerializeField] internal ArrayHolder<Rect>[] allRectColumns; |
| | | 87 | | [SerializeField] internal ArrayHolder<RectInt>[] allRectIntColumns; |
| | | 88 | | [SerializeField] internal ArrayHolder<Color>[] allColorColumns; |
| | | 89 | | [SerializeField] internal ArrayHolder<LayerMask>[] allLayerMaskColumns; |
| | | 90 | | [SerializeField] internal ArrayHolder<Bounds>[] allBoundsColumns; |
| | | 91 | | [SerializeField] internal ArrayHolder<BoundsInt>[] allBoundsIntColumns; |
| | | 92 | | [SerializeField] internal ArrayHolder<Hash128>[] allHash128Columns; |
| | | 93 | | [SerializeField] internal ArrayHolder<Gradient>[] allGradientColumns; |
| | | 94 | | [SerializeField] internal ArrayHolder<AnimationCurve>[] allAnimationCurveColumns; |
| | | 95 | | [SerializeField] internal ArrayHolder<UnityEngine.Object>[] allObjectRefColumns; |
| | 0 | 96 | | [SerializeField] internal ArrayHolder<string>[] allColumnNames = new ArrayHolder<string>[(int)ColumnType.Count]; |
| | 0 | 97 | | [SerializeField] internal ArrayHolder<int>[] allColumnOrders = new ArrayHolder<int>[(int)ColumnType.Count]; // C |
| | | 98 | | |
| | | 99 | | |
| | | 100 | | [SerializeField] |
| | | 101 | | internal string[] allRowNames; |
| | | 102 | | |
| | | 103 | | [SerializeField] |
| | | 104 | | internal int rowCount; |
| | | 105 | | |
| | | 106 | | [SerializeField] |
| | | 107 | | internal ColumnEntryInternal[] columnIDToDenseIndexMap; |
| | | 108 | | |
| | | 109 | | // TODO move with other block |
| | 0 | 110 | | [SerializeField] ArrayHolder<int>[] columnDenseIndexToIDMap = new ArrayHolder<int>[(int)ColumnType.Count]; |
| | | 111 | | |
| | | 112 | | [SerializeField] |
| | | 113 | | internal int columnEntriesFreeListHead; |
| | | 114 | | |
| | | 115 | | [SerializeField] |
| | | 116 | | internal int combinedColumnCount; |
| | | 117 | | |
| | | 118 | | [SerializeField] |
| | 0 | 119 | | internal ulong dataVersion = 1; |
| | | 120 | | |
| | | 121 | | // BEGIN - View Hacks |
| | | 122 | | public int ColumnCount |
| | | 123 | | { |
| | | 124 | | get |
| | 0 | 125 | | { |
| | 0 | 126 | | return combinedColumnCount; |
| | 0 | 127 | | } |
| | | 128 | | } |
| | | 129 | | |
| | | 130 | | public int RowCount |
| | | 131 | | { |
| | | 132 | | get |
| | 0 | 133 | | { |
| | 0 | 134 | | return rowCount; |
| | 0 | 135 | | } |
| | | 136 | | } |
| | | 137 | | |
| | | 138 | | public ColumnEntry[] GetOrderedColumns() |
| | 0 | 139 | | { |
| | 0 | 140 | | if (combinedColumnCount == 0) return null; |
| | | 141 | | |
| | 0 | 142 | | int columnCount = (int)ColumnType.Count; |
| | 0 | 143 | | ColumnEntry[] returnArray = new ColumnEntry[combinedColumnCount]; |
| | | 144 | | |
| | 0 | 145 | | for (int columnIndex = 0; columnIndex < columnCount; columnIndex++) |
| | 0 | 146 | | { |
| | | 147 | | |
| | 0 | 148 | | int[] columnOrders = allColumnOrders[columnIndex].TArray; |
| | 0 | 149 | | int columnOrdersLength = columnOrders?.Length ?? 0; |
| | | 150 | | |
| | 0 | 151 | | int[] columnIndices = columnDenseIndexToIDMap[columnIndex].TArray; |
| | 0 | 152 | | string[] columnNames = allColumnNames[columnIndex].TArray; |
| | | 153 | | |
| | 0 | 154 | | for (int i = 0; i < columnOrdersLength; i++) |
| | 0 | 155 | | { |
| | 0 | 156 | | returnArray[columnOrders[i]] = new ColumnEntry |
| | | 157 | | { |
| | | 158 | | Name = columnNames[i], |
| | | 159 | | Id = columnIndices[i], |
| | | 160 | | Type = (ColumnType)columnIndex |
| | | 161 | | }; |
| | 0 | 162 | | } |
| | 0 | 163 | | } |
| | 0 | 164 | | return returnArray; |
| | 0 | 165 | | } |
| | | 166 | | |
| | | 167 | | |
| | | 168 | | // END - View Hacks |
| | | 169 | | |
| | | 170 | | // TODO: Way to set column name |
| | | 171 | | |
| | | 172 | | |
| | | 173 | | |
| | | 174 | | public void AddRow(string rowName = null, int insertAt = -1) |
| | 0 | 175 | | { |
| | 0 | 176 | | insertAt = insertAt < 0 ? rowCount : insertAt; |
| | | 177 | | |
| | 0 | 178 | | Array.Resize(ref allRowNames, rowCount + 1); |
| | 0 | 179 | | for (int i = rowCount; i > insertAt; i--) |
| | 0 | 180 | | { |
| | 0 | 181 | | allRowNames[i] = allRowNames[i - 1]; |
| | 0 | 182 | | } |
| | | 183 | | |
| | 0 | 184 | | rowName ??= string.Empty; |
| | 0 | 185 | | allRowNames[insertAt] = rowName; |
| | | 186 | | |
| | 0 | 187 | | InsertRowsOfTypeInternal(ref allStringColumns, insertAt, 1); |
| | 0 | 188 | | InsertRowsOfTypeInternal(ref allBoolColumns, insertAt, 1); |
| | 0 | 189 | | InsertRowsOfTypeInternal(ref allCharColumns, insertAt, 1); |
| | 0 | 190 | | InsertRowsOfTypeInternal(ref allSbyteColumns, insertAt, 1); |
| | 0 | 191 | | InsertRowsOfTypeInternal(ref allByteColumns, insertAt, 1); |
| | 0 | 192 | | InsertRowsOfTypeInternal(ref allShortColumns, insertAt, 1); |
| | 0 | 193 | | InsertRowsOfTypeInternal(ref allUshortColumns, insertAt, 1); |
| | 0 | 194 | | InsertRowsOfTypeInternal(ref allIntColumns, insertAt, 1); |
| | 0 | 195 | | InsertRowsOfTypeInternal(ref allUintColumns, insertAt, 1); |
| | 0 | 196 | | InsertRowsOfTypeInternal(ref allLongColumns, insertAt, 1); |
| | 0 | 197 | | InsertRowsOfTypeInternal(ref allUlongColumns, insertAt, 1); |
| | 0 | 198 | | InsertRowsOfTypeInternal(ref allFloatColumns, insertAt, 1); |
| | 0 | 199 | | InsertRowsOfTypeInternal(ref allDoubleColumns, insertAt, 1); |
| | 0 | 200 | | InsertRowsOfTypeInternal(ref allVector2Columns, insertAt, 1); |
| | 0 | 201 | | InsertRowsOfTypeInternal(ref allVector3Columns, insertAt, 1); |
| | 0 | 202 | | InsertRowsOfTypeInternal(ref allVector4Columns, insertAt, 1); |
| | 0 | 203 | | InsertRowsOfTypeInternal(ref allVector2IntColumns, insertAt, 1); |
| | 0 | 204 | | InsertRowsOfTypeInternal(ref allVector3IntColumns, insertAt, 1); |
| | 0 | 205 | | InsertRowsOfTypeInternal(ref allQuaternionColumns, insertAt, 1); |
| | 0 | 206 | | InsertRowsOfTypeInternal(ref allRectColumns, insertAt, 1); |
| | 0 | 207 | | InsertRowsOfTypeInternal(ref allRectIntColumns, insertAt, 1); |
| | 0 | 208 | | InsertRowsOfTypeInternal(ref allColorColumns, insertAt, 1); |
| | 0 | 209 | | InsertRowsOfTypeInternal(ref allLayerMaskColumns, insertAt, 1); |
| | 0 | 210 | | InsertRowsOfTypeInternal(ref allBoundsColumns, insertAt, 1); |
| | 0 | 211 | | InsertRowsOfTypeInternal(ref allBoundsIntColumns, insertAt, 1); |
| | 0 | 212 | | InsertRowsOfTypeInternal(ref allHash128Columns, insertAt, 1); |
| | 0 | 213 | | InsertRowsOfTypeInternal(ref allGradientColumns, insertAt, 1); |
| | 0 | 214 | | InsertRowsOfTypeInternal(ref allAnimationCurveColumns, insertAt, 1); |
| | 0 | 215 | | InsertRowsOfTypeInternal(ref allObjectRefColumns, insertAt, 1); |
| | | 216 | | |
| | 0 | 217 | | ++rowCount; |
| | 0 | 218 | | dataVersion++; |
| | 0 | 219 | | } |
| | | 220 | | |
| | | 221 | | public void AddRows(int numberOfNewRows, string[] rowNames = null, int insertAt = -1) |
| | 0 | 222 | | { |
| | 0 | 223 | | insertAt = insertAt < 0 ? rowCount : insertAt; |
| | | 224 | | |
| | 0 | 225 | | Array.Resize(ref allRowNames, rowCount + 1); |
| | 0 | 226 | | for (int i = rowCount; i > insertAt; i--) |
| | 0 | 227 | | { |
| | 0 | 228 | | allRowNames[i] = allRowNames[i - 1]; |
| | 0 | 229 | | } |
| | | 230 | | |
| | 0 | 231 | | string empty = string.Empty; |
| | 0 | 232 | | int rowNamesLength = rowNames?.Length ?? 0; |
| | 0 | 233 | | for (int i = 0; i < rowNames.Length; i++) |
| | 0 | 234 | | { |
| | 0 | 235 | | string nameAt = rowNames[i]; |
| | 0 | 236 | | allRowNames[insertAt + i] = nameAt ?? empty; |
| | 0 | 237 | | } |
| | | 238 | | |
| | 0 | 239 | | for (int i = rowNamesLength; i < numberOfNewRows; i++) |
| | 0 | 240 | | { |
| | 0 | 241 | | allRowNames[insertAt + i] = empty; |
| | 0 | 242 | | } |
| | | 243 | | |
| | 0 | 244 | | InsertRowsOfTypeInternal(ref allStringColumns, insertAt, numberOfNewRows); |
| | 0 | 245 | | InsertRowsOfTypeInternal(ref allBoolColumns, insertAt, numberOfNewRows); |
| | 0 | 246 | | InsertRowsOfTypeInternal(ref allCharColumns, insertAt, numberOfNewRows); |
| | 0 | 247 | | InsertRowsOfTypeInternal(ref allSbyteColumns, insertAt, numberOfNewRows); |
| | 0 | 248 | | InsertRowsOfTypeInternal(ref allByteColumns, insertAt, numberOfNewRows); |
| | 0 | 249 | | InsertRowsOfTypeInternal(ref allShortColumns, insertAt, numberOfNewRows); |
| | 0 | 250 | | InsertRowsOfTypeInternal(ref allUshortColumns, insertAt, numberOfNewRows); |
| | 0 | 251 | | InsertRowsOfTypeInternal(ref allIntColumns, insertAt, numberOfNewRows); |
| | 0 | 252 | | InsertRowsOfTypeInternal(ref allUintColumns, insertAt, numberOfNewRows); |
| | 0 | 253 | | InsertRowsOfTypeInternal(ref allLongColumns, insertAt, numberOfNewRows); |
| | 0 | 254 | | InsertRowsOfTypeInternal(ref allUlongColumns, insertAt, numberOfNewRows); |
| | 0 | 255 | | InsertRowsOfTypeInternal(ref allFloatColumns, insertAt, numberOfNewRows); |
| | 0 | 256 | | InsertRowsOfTypeInternal(ref allDoubleColumns, insertAt, numberOfNewRows); |
| | 0 | 257 | | InsertRowsOfTypeInternal(ref allVector2Columns, insertAt, numberOfNewRows); |
| | 0 | 258 | | InsertRowsOfTypeInternal(ref allVector3Columns, insertAt, numberOfNewRows); |
| | 0 | 259 | | InsertRowsOfTypeInternal(ref allVector4Columns, insertAt, numberOfNewRows); |
| | 0 | 260 | | InsertRowsOfTypeInternal(ref allVector2IntColumns, insertAt, numberOfNewRows); |
| | 0 | 261 | | InsertRowsOfTypeInternal(ref allVector3IntColumns, insertAt, numberOfNewRows); |
| | 0 | 262 | | InsertRowsOfTypeInternal(ref allQuaternionColumns, insertAt, numberOfNewRows); |
| | 0 | 263 | | InsertRowsOfTypeInternal(ref allRectColumns, insertAt, numberOfNewRows); |
| | 0 | 264 | | InsertRowsOfTypeInternal(ref allRectIntColumns, insertAt, numberOfNewRows); |
| | 0 | 265 | | InsertRowsOfTypeInternal(ref allColorColumns, insertAt, numberOfNewRows); |
| | 0 | 266 | | InsertRowsOfTypeInternal(ref allLayerMaskColumns, insertAt, numberOfNewRows); |
| | 0 | 267 | | InsertRowsOfTypeInternal(ref allBoundsColumns, insertAt, numberOfNewRows); |
| | 0 | 268 | | InsertRowsOfTypeInternal(ref allBoundsIntColumns, insertAt, numberOfNewRows); |
| | 0 | 269 | | InsertRowsOfTypeInternal(ref allHash128Columns, insertAt, numberOfNewRows); |
| | 0 | 270 | | InsertRowsOfTypeInternal(ref allGradientColumns, insertAt, numberOfNewRows); |
| | 0 | 271 | | InsertRowsOfTypeInternal(ref allAnimationCurveColumns, insertAt, numberOfNewRows); |
| | 0 | 272 | | InsertRowsOfTypeInternal(ref allObjectRefColumns, insertAt, numberOfNewRows); |
| | | 273 | | |
| | 0 | 274 | | rowCount += numberOfNewRows; |
| | 0 | 275 | | dataVersion++; |
| | 0 | 276 | | } |
| | | 277 | | |
| | | 278 | | public void RemoveRow(int removeAt) |
| | 0 | 279 | | { |
| | 0 | 280 | | int newRowCount = rowCount - 1; |
| | 0 | 281 | | for (int j = removeAt; j < newRowCount; j++) |
| | 0 | 282 | | { |
| | 0 | 283 | | allRowNames[j] = allRowNames[j + 1]; |
| | 0 | 284 | | } |
| | | 285 | | |
| | 0 | 286 | | Array.Resize(ref allRowNames, newRowCount); |
| | | 287 | | |
| | 0 | 288 | | DeleteRowsOfTypeInternal(ref allStringColumns, removeAt, 1); |
| | 0 | 289 | | DeleteRowsOfTypeInternal(ref allBoolColumns, removeAt, 1); |
| | 0 | 290 | | DeleteRowsOfTypeInternal(ref allCharColumns, removeAt, 1); |
| | 0 | 291 | | DeleteRowsOfTypeInternal(ref allSbyteColumns, removeAt, 1); |
| | 0 | 292 | | DeleteRowsOfTypeInternal(ref allByteColumns, removeAt, 1); |
| | 0 | 293 | | DeleteRowsOfTypeInternal(ref allShortColumns, removeAt, 1); |
| | 0 | 294 | | DeleteRowsOfTypeInternal(ref allUshortColumns, removeAt, 1); |
| | 0 | 295 | | DeleteRowsOfTypeInternal(ref allIntColumns, removeAt, 1); |
| | 0 | 296 | | DeleteRowsOfTypeInternal(ref allUintColumns, removeAt, 1); |
| | 0 | 297 | | DeleteRowsOfTypeInternal(ref allLongColumns, removeAt, 1); |
| | 0 | 298 | | DeleteRowsOfTypeInternal(ref allUlongColumns, removeAt, 1); |
| | 0 | 299 | | DeleteRowsOfTypeInternal(ref allFloatColumns, removeAt, 1); |
| | 0 | 300 | | DeleteRowsOfTypeInternal(ref allDoubleColumns, removeAt, 1); |
| | 0 | 301 | | DeleteRowsOfTypeInternal(ref allVector2Columns, removeAt, 1); |
| | 0 | 302 | | DeleteRowsOfTypeInternal(ref allVector3Columns, removeAt, 1); |
| | 0 | 303 | | DeleteRowsOfTypeInternal(ref allVector4Columns, removeAt, 1); |
| | 0 | 304 | | DeleteRowsOfTypeInternal(ref allVector2IntColumns, removeAt, 1); |
| | 0 | 305 | | DeleteRowsOfTypeInternal(ref allVector3IntColumns, removeAt, 1); |
| | 0 | 306 | | DeleteRowsOfTypeInternal(ref allQuaternionColumns, removeAt, 1); |
| | 0 | 307 | | DeleteRowsOfTypeInternal(ref allRectColumns, removeAt, 1); |
| | 0 | 308 | | DeleteRowsOfTypeInternal(ref allRectIntColumns, removeAt, 1); |
| | 0 | 309 | | DeleteRowsOfTypeInternal(ref allColorColumns, removeAt, 1); |
| | 0 | 310 | | DeleteRowsOfTypeInternal(ref allLayerMaskColumns, removeAt, 1); |
| | 0 | 311 | | DeleteRowsOfTypeInternal(ref allBoundsColumns, removeAt, 1); |
| | 0 | 312 | | DeleteRowsOfTypeInternal(ref allBoundsIntColumns, removeAt, 1); |
| | 0 | 313 | | DeleteRowsOfTypeInternal(ref allHash128Columns, removeAt, 1); |
| | 0 | 314 | | DeleteRowsOfTypeInternal(ref allGradientColumns, removeAt, 1); |
| | 0 | 315 | | DeleteRowsOfTypeInternal(ref allAnimationCurveColumns, removeAt, 1); |
| | 0 | 316 | | DeleteRowsOfTypeInternal(ref allObjectRefColumns, removeAt, 1); |
| | | 317 | | |
| | 0 | 318 | | --rowCount; |
| | 0 | 319 | | dataVersion++; |
| | 0 | 320 | | } |
| | | 321 | | |
| | | 322 | | public void RemoveRows(int removeAt, int numberOfRowsToDelete) |
| | 0 | 323 | | { |
| | 0 | 324 | | int newRowCount = rowCount - numberOfRowsToDelete; |
| | 0 | 325 | | for (int j = removeAt; j < rowCount - numberOfRowsToDelete; j++) |
| | 0 | 326 | | { |
| | 0 | 327 | | allRowNames[j] = allRowNames[j + numberOfRowsToDelete]; |
| | 0 | 328 | | } |
| | | 329 | | |
| | 0 | 330 | | Array.Resize(ref allRowNames, newRowCount); |
| | | 331 | | |
| | 0 | 332 | | DeleteRowsOfTypeInternal(ref allStringColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 333 | | DeleteRowsOfTypeInternal(ref allBoolColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 334 | | DeleteRowsOfTypeInternal(ref allCharColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 335 | | DeleteRowsOfTypeInternal(ref allSbyteColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 336 | | DeleteRowsOfTypeInternal(ref allByteColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 337 | | DeleteRowsOfTypeInternal(ref allShortColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 338 | | DeleteRowsOfTypeInternal(ref allUshortColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 339 | | DeleteRowsOfTypeInternal(ref allIntColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 340 | | DeleteRowsOfTypeInternal(ref allUintColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 341 | | DeleteRowsOfTypeInternal(ref allLongColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 342 | | DeleteRowsOfTypeInternal(ref allUlongColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 343 | | DeleteRowsOfTypeInternal(ref allFloatColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 344 | | DeleteRowsOfTypeInternal(ref allDoubleColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 345 | | DeleteRowsOfTypeInternal(ref allVector2Columns, removeAt, numberOfRowsToDelete); |
| | 0 | 346 | | DeleteRowsOfTypeInternal(ref allVector3Columns, removeAt, numberOfRowsToDelete); |
| | 0 | 347 | | DeleteRowsOfTypeInternal(ref allVector4Columns, removeAt, numberOfRowsToDelete); |
| | 0 | 348 | | DeleteRowsOfTypeInternal(ref allVector2IntColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 349 | | DeleteRowsOfTypeInternal(ref allVector3IntColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 350 | | DeleteRowsOfTypeInternal(ref allQuaternionColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 351 | | DeleteRowsOfTypeInternal(ref allRectColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 352 | | DeleteRowsOfTypeInternal(ref allRectIntColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 353 | | DeleteRowsOfTypeInternal(ref allColorColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 354 | | DeleteRowsOfTypeInternal(ref allLayerMaskColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 355 | | DeleteRowsOfTypeInternal(ref allBoundsColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 356 | | DeleteRowsOfTypeInternal(ref allBoundsIntColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 357 | | DeleteRowsOfTypeInternal(ref allHash128Columns, removeAt, numberOfRowsToDelete); |
| | 0 | 358 | | DeleteRowsOfTypeInternal(ref allGradientColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 359 | | DeleteRowsOfTypeInternal(ref allAnimationCurveColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 360 | | DeleteRowsOfTypeInternal(ref allObjectRefColumns, removeAt, numberOfRowsToDelete); |
| | | 361 | | |
| | 0 | 362 | | rowCount -= numberOfRowsToDelete; |
| | 0 | 363 | | dataVersion++; |
| | 0 | 364 | | } |
| | | 365 | | |
| | | 366 | | // Add Column |
| | | 367 | | |
| | | 368 | | public int AddStringColumn(string columnName, int insertAt = -1) |
| | 0 | 369 | | { |
| | 0 | 370 | | return AddColumnInternal(columnName, ref allStringColumns, ColumnType.String, insertAt); |
| | 0 | 371 | | } |
| | | 372 | | |
| | | 373 | | public int AddBoolColumn(string columnName, int insertAt = -1) |
| | 0 | 374 | | { |
| | 0 | 375 | | return AddColumnInternal(columnName, ref allBoolColumns, ColumnType.Bool, insertAt); |
| | 0 | 376 | | } |
| | | 377 | | |
| | | 378 | | public int AddCharColumn(string columnName, int insertAt = -1) |
| | 0 | 379 | | { |
| | 0 | 380 | | return AddColumnInternal(columnName, ref allCharColumns, ColumnType.Char, insertAt); |
| | 0 | 381 | | } |
| | | 382 | | |
| | | 383 | | public int AddSbyteColumn(string columnName, int insertAt = -1) |
| | 0 | 384 | | { |
| | 0 | 385 | | return AddColumnInternal(columnName, ref allSbyteColumns, ColumnType.Sbyte, insertAt); |
| | 0 | 386 | | } |
| | | 387 | | |
| | | 388 | | public int AddByteColumn(string columnName, int insertAt = -1) |
| | 0 | 389 | | { |
| | 0 | 390 | | return AddColumnInternal(columnName, ref allByteColumns, ColumnType.Byte, insertAt); |
| | 0 | 391 | | } |
| | | 392 | | |
| | | 393 | | public int AddShortColumn(string columnName, int insertAt = -1) |
| | 0 | 394 | | { |
| | 0 | 395 | | return AddColumnInternal(columnName, ref allShortColumns, ColumnType.Short, insertAt); |
| | 0 | 396 | | } |
| | | 397 | | |
| | | 398 | | public int AddUshortColumn(string columnName, int insertAt = -1) |
| | 0 | 399 | | { |
| | 0 | 400 | | return AddColumnInternal(columnName, ref allUshortColumns, ColumnType.Ushort, insertAt); |
| | 0 | 401 | | } |
| | | 402 | | |
| | | 403 | | public int AddIntColumn(string columnName, int insertAt = -1) |
| | 0 | 404 | | { |
| | 0 | 405 | | return AddColumnInternal(columnName, ref allIntColumns, ColumnType.Int, insertAt); |
| | 0 | 406 | | } |
| | | 407 | | |
| | | 408 | | public int AddUintColumn(string columnName, int insertAt = -1) |
| | 0 | 409 | | { |
| | 0 | 410 | | return AddColumnInternal(columnName, ref allUintColumns, ColumnType.Uint, insertAt); |
| | 0 | 411 | | } |
| | | 412 | | |
| | | 413 | | public int AddLongColumn(string columnName, int insertAt = -1) |
| | 0 | 414 | | { |
| | 0 | 415 | | return AddColumnInternal(columnName, ref allLongColumns, ColumnType.Long, insertAt); |
| | 0 | 416 | | } |
| | | 417 | | |
| | | 418 | | public int AddUlongColumn(string columnName, int insertAt = -1) |
| | 0 | 419 | | { |
| | 0 | 420 | | return AddColumnInternal(columnName, ref allUlongColumns, ColumnType.Ulong, insertAt); |
| | 0 | 421 | | } |
| | | 422 | | |
| | | 423 | | public int AddFloatColumn(string columnName, int insertAt = -1) |
| | 0 | 424 | | { |
| | 0 | 425 | | return AddColumnInternal(columnName, ref allFloatColumns, ColumnType.Float, insertAt); |
| | 0 | 426 | | } |
| | | 427 | | |
| | | 428 | | public int AddDoubleColumn(string columnName, int insertAt = -1) |
| | 0 | 429 | | { |
| | 0 | 430 | | return AddColumnInternal(columnName, ref allDoubleColumns, ColumnType.Double, insertAt); |
| | 0 | 431 | | } |
| | | 432 | | |
| | | 433 | | public int AddVector2Column(string columnName, int insertAt = -1) |
| | 0 | 434 | | { |
| | 0 | 435 | | return AddColumnInternal(columnName, ref allVector2Columns, ColumnType.Vector2, insertAt); |
| | 0 | 436 | | } |
| | | 437 | | |
| | | 438 | | public int AddVector3Column(string columnName, int insertAt = -1) |
| | 0 | 439 | | { |
| | 0 | 440 | | return AddColumnInternal(columnName, ref allVector3Columns, ColumnType.Vector3, insertAt); |
| | 0 | 441 | | } |
| | | 442 | | |
| | | 443 | | public int AddVector4Column(string columnName, int insertAt = -1) |
| | 0 | 444 | | { |
| | 0 | 445 | | return AddColumnInternal(columnName, ref allVector4Columns, ColumnType.Vector4, insertAt); |
| | 0 | 446 | | } |
| | | 447 | | |
| | | 448 | | public int AddVector2IntColumn(string columnName, int insertAt = -1) |
| | 0 | 449 | | { |
| | 0 | 450 | | return AddColumnInternal(columnName, ref allVector2IntColumns, ColumnType.Vector2Int, insertAt); |
| | 0 | 451 | | } |
| | | 452 | | |
| | | 453 | | public int AddVector3IntColumn(string columnName, int insertAt = -1) |
| | 0 | 454 | | { |
| | 0 | 455 | | return AddColumnInternal(columnName, ref allVector3IntColumns, ColumnType.Vector3Int, insertAt); |
| | 0 | 456 | | } |
| | | 457 | | |
| | | 458 | | public int AddQuaternionColumn(string columnName, int insertAt = -1) |
| | 0 | 459 | | { |
| | 0 | 460 | | return AddColumnInternal(columnName, ref allQuaternionColumns, ColumnType.Quaternion, insertAt); |
| | 0 | 461 | | } |
| | | 462 | | |
| | | 463 | | public int AddRectColumn(string columnName, int insertAt = -1) |
| | 0 | 464 | | { |
| | 0 | 465 | | return AddColumnInternal(columnName, ref allRectColumns, ColumnType.Rect, insertAt); |
| | 0 | 466 | | } |
| | | 467 | | |
| | | 468 | | public int AddRectIntColumn(string columnName, int insertAt = -1) |
| | 0 | 469 | | { |
| | 0 | 470 | | return AddColumnInternal(columnName, ref allRectIntColumns, ColumnType.RectInt, insertAt); |
| | 0 | 471 | | } |
| | | 472 | | |
| | | 473 | | public int AddColorColumn(string columnName, int insertAt = -1) |
| | 0 | 474 | | { |
| | 0 | 475 | | return AddColumnInternal(columnName, ref allColorColumns, ColumnType.Color, insertAt); |
| | 0 | 476 | | } |
| | | 477 | | |
| | | 478 | | public int AddLayerMaskColumn(string columnName, int insertAt = -1) |
| | 0 | 479 | | { |
| | 0 | 480 | | return AddColumnInternal(columnName, ref allLayerMaskColumns, ColumnType.LayerMask, insertAt); |
| | 0 | 481 | | } |
| | | 482 | | |
| | | 483 | | public int AddBoundsColumn(string columnName, int insertAt = -1) |
| | 0 | 484 | | { |
| | 0 | 485 | | return AddColumnInternal(columnName, ref allBoundsColumns, ColumnType.Bounds, insertAt); |
| | 0 | 486 | | } |
| | | 487 | | |
| | | 488 | | public int AddBoundsIntColumn(string columnName, int insertAt = -1) |
| | 0 | 489 | | { |
| | 0 | 490 | | return AddColumnInternal(columnName, ref allBoundsIntColumns, ColumnType.BoundsInt, insertAt); |
| | 0 | 491 | | } |
| | | 492 | | |
| | | 493 | | public int AddHash128Column(string columnName, int insertAt = -1) |
| | 0 | 494 | | { |
| | 0 | 495 | | return AddColumnInternal(columnName, ref allHash128Columns, ColumnType.Hash128, insertAt); |
| | 0 | 496 | | } |
| | | 497 | | |
| | | 498 | | public int AddGradientColumn(string columnName, int insertAt = -1) |
| | 0 | 499 | | { |
| | 0 | 500 | | return AddColumnInternal(columnName, ref allGradientColumns, ColumnType.Gradient, insertAt); |
| | 0 | 501 | | } |
| | | 502 | | |
| | | 503 | | public int AddAnimationCurveColumn(string columnName, int insertAt = -1) |
| | 0 | 504 | | { |
| | 0 | 505 | | return AddColumnInternal(columnName, ref allAnimationCurveColumns, ColumnType.AnimationCurve, insertAt); |
| | 0 | 506 | | } |
| | | 507 | | |
| | | 508 | | public int AddObjectColumn(string columnName, int insertAt = -1) |
| | 0 | 509 | | { |
| | 0 | 510 | | return AddColumnInternal(columnName, ref allObjectRefColumns, ColumnType.Object, insertAt); |
| | 0 | 511 | | } |
| | | 512 | | |
| | | 513 | | // Remove Column |
| | | 514 | | |
| | | 515 | | public void RemoveStringColumn(int removeAt) |
| | 0 | 516 | | { |
| | 0 | 517 | | RemoveColumnInternal(ref allStringColumns, ColumnType.String, removeAt); |
| | 0 | 518 | | } |
| | | 519 | | |
| | | 520 | | public void RemoveBoolColumn(int removeAt) |
| | 0 | 521 | | { |
| | 0 | 522 | | RemoveColumnInternal(ref allBoolColumns, ColumnType.Bool, removeAt); |
| | 0 | 523 | | } |
| | | 524 | | |
| | | 525 | | public void RemoveCharColumn(int removeAt) |
| | 0 | 526 | | { |
| | 0 | 527 | | RemoveColumnInternal(ref allCharColumns, ColumnType.Char, removeAt); |
| | 0 | 528 | | } |
| | | 529 | | |
| | | 530 | | public void RemoveSbyteColumn(int removeAt) |
| | 0 | 531 | | { |
| | 0 | 532 | | RemoveColumnInternal(ref allSbyteColumns, ColumnType.Sbyte, removeAt); |
| | 0 | 533 | | } |
| | | 534 | | |
| | | 535 | | public void RemoveByteColumn(int removeAt) |
| | 0 | 536 | | { |
| | 0 | 537 | | RemoveColumnInternal(ref allByteColumns, ColumnType.Byte, removeAt); |
| | 0 | 538 | | } |
| | | 539 | | |
| | | 540 | | public void RemoveShortColumn(int removeAt) |
| | 0 | 541 | | { |
| | 0 | 542 | | RemoveColumnInternal(ref allShortColumns, ColumnType.Short, removeAt); |
| | 0 | 543 | | } |
| | | 544 | | |
| | | 545 | | public void RemoveUshortColumn(int removeAt) |
| | 0 | 546 | | { |
| | 0 | 547 | | RemoveColumnInternal(ref allUshortColumns, ColumnType.Ushort, removeAt); |
| | 0 | 548 | | } |
| | | 549 | | |
| | | 550 | | public void RemoveIntColumn(int removeAt) |
| | 0 | 551 | | { |
| | 0 | 552 | | RemoveColumnInternal(ref allIntColumns, ColumnType.Int, removeAt); |
| | 0 | 553 | | } |
| | | 554 | | |
| | | 555 | | public void RemoveUintColumn(int removeAt) |
| | 0 | 556 | | { |
| | 0 | 557 | | RemoveColumnInternal(ref allUintColumns, ColumnType.Uint, removeAt); |
| | 0 | 558 | | } |
| | | 559 | | |
| | | 560 | | public void RemoveLongColumn(int removeAt) |
| | 0 | 561 | | { |
| | 0 | 562 | | RemoveColumnInternal(ref allLongColumns, ColumnType.Long, removeAt); |
| | 0 | 563 | | } |
| | | 564 | | |
| | | 565 | | public void RemoveUlongColumn(int removeAt) |
| | 0 | 566 | | { |
| | 0 | 567 | | RemoveColumnInternal(ref allUlongColumns, ColumnType.Ulong, removeAt); |
| | 0 | 568 | | } |
| | | 569 | | |
| | | 570 | | public void RemoveFloatColumn(int removeAt) |
| | 0 | 571 | | { |
| | 0 | 572 | | RemoveColumnInternal(ref allFloatColumns, ColumnType.Float, removeAt); |
| | 0 | 573 | | } |
| | | 574 | | |
| | | 575 | | public void RemoveDoubleColumn(int removeAt) |
| | 0 | 576 | | { |
| | 0 | 577 | | RemoveColumnInternal(ref allDoubleColumns, ColumnType.Double, removeAt); |
| | 0 | 578 | | } |
| | | 579 | | |
| | | 580 | | public void RemoveVector2Column(int removeAt) |
| | 0 | 581 | | { |
| | 0 | 582 | | RemoveColumnInternal(ref allVector2Columns, ColumnType.Vector2, removeAt); |
| | 0 | 583 | | } |
| | | 584 | | |
| | | 585 | | public void RemoveVector3Column(int removeAt) |
| | 0 | 586 | | { |
| | 0 | 587 | | RemoveColumnInternal(ref allVector3Columns, ColumnType.Vector3, removeAt); |
| | 0 | 588 | | } |
| | | 589 | | |
| | | 590 | | public void RemoveVector4Column(int removeAt) |
| | 0 | 591 | | { |
| | 0 | 592 | | RemoveColumnInternal(ref allVector4Columns, ColumnType.Vector4, removeAt); |
| | 0 | 593 | | } |
| | | 594 | | |
| | | 595 | | public void RemoveVector2IntColumn(int removeAt) |
| | 0 | 596 | | { |
| | 0 | 597 | | RemoveColumnInternal(ref allVector2IntColumns, ColumnType.Vector2Int, removeAt); |
| | 0 | 598 | | } |
| | | 599 | | |
| | | 600 | | public void RemoveVector3IntColumn(int removeAt) |
| | 0 | 601 | | { |
| | 0 | 602 | | RemoveColumnInternal(ref allVector3IntColumns, ColumnType.Vector3Int, removeAt); |
| | 0 | 603 | | } |
| | | 604 | | |
| | | 605 | | public void RemoveQuaternionColumn(int removeAt) |
| | 0 | 606 | | { |
| | 0 | 607 | | RemoveColumnInternal(ref allQuaternionColumns, ColumnType.Quaternion, removeAt); |
| | 0 | 608 | | } |
| | | 609 | | |
| | | 610 | | public void RemoveRectColumn(int removeAt) |
| | 0 | 611 | | { |
| | 0 | 612 | | RemoveColumnInternal(ref allRectColumns, ColumnType.Rect, removeAt); |
| | 0 | 613 | | } |
| | | 614 | | |
| | | 615 | | public void RemoveRectIntColumn(int removeAt) |
| | 0 | 616 | | { |
| | 0 | 617 | | RemoveColumnInternal(ref allRectIntColumns, ColumnType.RectInt, removeAt); |
| | 0 | 618 | | } |
| | | 619 | | |
| | | 620 | | public void RemoveColorColumn(int removeAt) |
| | 0 | 621 | | { |
| | 0 | 622 | | RemoveColumnInternal(ref allColorColumns, ColumnType.Color, removeAt); |
| | 0 | 623 | | } |
| | | 624 | | |
| | | 625 | | public void RemoveLayerMaskColumn(int removeAt) |
| | 0 | 626 | | { |
| | 0 | 627 | | RemoveColumnInternal(ref allLayerMaskColumns, ColumnType.LayerMask, removeAt); |
| | 0 | 628 | | } |
| | | 629 | | |
| | | 630 | | public void RemoveBoundsColumn(int removeAt) |
| | 0 | 631 | | { |
| | 0 | 632 | | RemoveColumnInternal(ref allBoundsColumns, ColumnType.Bounds, removeAt); |
| | 0 | 633 | | } |
| | | 634 | | |
| | | 635 | | public void RemoveBoundsIntColumn(int removeAt) |
| | 0 | 636 | | { |
| | 0 | 637 | | RemoveColumnInternal(ref allBoundsIntColumns, ColumnType.BoundsInt, removeAt); |
| | 0 | 638 | | } |
| | | 639 | | |
| | | 640 | | public void RemoveHash128Column(int removeAt) |
| | 0 | 641 | | { |
| | 0 | 642 | | RemoveColumnInternal(ref allHash128Columns, ColumnType.Hash128, removeAt); |
| | 0 | 643 | | } |
| | | 644 | | |
| | | 645 | | public void RemoveGradientColumn(int removeAt) |
| | 0 | 646 | | { |
| | 0 | 647 | | RemoveColumnInternal(ref allGradientColumns, ColumnType.Gradient, removeAt); |
| | 0 | 648 | | } |
| | | 649 | | |
| | | 650 | | public void RemoveAnimationCurveColumn(int removeAt) |
| | 0 | 651 | | { |
| | 0 | 652 | | RemoveColumnInternal(ref allAnimationCurveColumns, ColumnType.AnimationCurve, removeAt); |
| | 0 | 653 | | } |
| | | 654 | | |
| | | 655 | | public void RemoveObjectColumn(int removeAt) |
| | 0 | 656 | | { |
| | 0 | 657 | | RemoveColumnInternal(ref allObjectRefColumns, ColumnType.Object, removeAt); |
| | 0 | 658 | | } |
| | | 659 | | |
| | | 660 | | // Set |
| | | 661 | | |
| | | 662 | | public void SetString(int row, int columnID, string value) |
| | 0 | 663 | | { |
| | 0 | 664 | | SetCell(row, columnID, ref allStringColumns, value); |
| | 0 | 665 | | } |
| | | 666 | | |
| | | 667 | | public void SetBool(int row, int columnID, bool value) |
| | 0 | 668 | | { |
| | 0 | 669 | | SetCell(row, columnID, ref allBoolColumns, value); |
| | 0 | 670 | | } |
| | | 671 | | |
| | | 672 | | public void SetChar(int row, int columnID, char value) |
| | 0 | 673 | | { |
| | 0 | 674 | | SetCell(row, columnID, ref allCharColumns, value); |
| | 0 | 675 | | } |
| | | 676 | | |
| | | 677 | | public void SetSbyte(int row, int columnID, sbyte value) |
| | 0 | 678 | | { |
| | 0 | 679 | | SetCell(row, columnID, ref allSbyteColumns, value); |
| | 0 | 680 | | } |
| | | 681 | | |
| | | 682 | | public void SetByte(int row, int columnID, byte value) |
| | 0 | 683 | | { |
| | 0 | 684 | | SetCell(row, columnID, ref allByteColumns, value); |
| | 0 | 685 | | } |
| | | 686 | | |
| | | 687 | | public void SetShort(int row, int columnID, short value) |
| | 0 | 688 | | { |
| | 0 | 689 | | SetCell(row, columnID, ref allShortColumns, value); |
| | 0 | 690 | | } |
| | | 691 | | |
| | | 692 | | public void SetUshort(int row, int columnID, ushort value) |
| | 0 | 693 | | { |
| | 0 | 694 | | SetCell(row, columnID, ref allUshortColumns, value); |
| | 0 | 695 | | } |
| | | 696 | | |
| | | 697 | | public void SetInt(int row, int columnID, int value) |
| | 0 | 698 | | { |
| | 0 | 699 | | SetCell(row, columnID, ref allIntColumns, value); |
| | 0 | 700 | | } |
| | | 701 | | |
| | | 702 | | public void SetUint(int row, int columnID, uint value) |
| | 0 | 703 | | { |
| | 0 | 704 | | SetCell(row, columnID, ref allUintColumns, value); |
| | 0 | 705 | | } |
| | | 706 | | |
| | | 707 | | public void SetLong(int row, int columnID, long value) |
| | 0 | 708 | | { |
| | 0 | 709 | | SetCell(row, columnID, ref allLongColumns, value); |
| | 0 | 710 | | } |
| | | 711 | | |
| | | 712 | | public void SetUlong(int row, int columnID, ulong value) |
| | 0 | 713 | | { |
| | 0 | 714 | | SetCell(row, columnID, ref allUlongColumns, value); |
| | 0 | 715 | | } |
| | | 716 | | |
| | | 717 | | public void SetFloat(int row, int columnID, float value) |
| | 0 | 718 | | { |
| | 0 | 719 | | SetCell(row, columnID, ref allFloatColumns, value); |
| | 0 | 720 | | } |
| | | 721 | | |
| | | 722 | | public void SetDouble(int row, int columnID, double value) |
| | 0 | 723 | | { |
| | 0 | 724 | | SetCell(row, columnID, ref allDoubleColumns, value); |
| | 0 | 725 | | } |
| | | 726 | | |
| | | 727 | | public void SetVector2(int row, int columnID, Vector2 value) |
| | 0 | 728 | | { |
| | 0 | 729 | | SetCell(row, columnID, ref allVector2Columns, value); |
| | 0 | 730 | | } |
| | | 731 | | |
| | | 732 | | public void SetVector3(int row, int columnID, Vector3 value) |
| | 0 | 733 | | { |
| | 0 | 734 | | SetCell(row, columnID, ref allVector3Columns, value); |
| | 0 | 735 | | } |
| | | 736 | | |
| | | 737 | | public void SetVector4(int row, int columnID, Vector4 value) |
| | 0 | 738 | | { |
| | 0 | 739 | | SetCell(row, columnID, ref allVector4Columns, value); |
| | 0 | 740 | | } |
| | | 741 | | |
| | | 742 | | public void SetVector2Int(int row, int columnID, Vector2Int value) |
| | 0 | 743 | | { |
| | 0 | 744 | | SetCell(row, columnID, ref allVector2IntColumns, value); |
| | 0 | 745 | | } |
| | | 746 | | |
| | | 747 | | public void SetVector3Int(int row, int columnID, Vector3Int value) |
| | 0 | 748 | | { |
| | 0 | 749 | | SetCell(row, columnID, ref allVector3IntColumns, value); |
| | 0 | 750 | | } |
| | | 751 | | |
| | | 752 | | public void SetQuaternion(int row, int columnID, Quaternion value) |
| | 0 | 753 | | { |
| | 0 | 754 | | SetCell(row, columnID, ref allQuaternionColumns, value); |
| | 0 | 755 | | } |
| | | 756 | | |
| | | 757 | | public void SetRect(int row, int columnID, Rect value) |
| | 0 | 758 | | { |
| | 0 | 759 | | SetCell(row, columnID, ref allRectColumns, value); |
| | 0 | 760 | | } |
| | | 761 | | |
| | | 762 | | public void SetRectInt(int row, int columnID, RectInt value) |
| | 0 | 763 | | { |
| | 0 | 764 | | SetCell(row, columnID, ref allRectIntColumns, value); |
| | 0 | 765 | | } |
| | | 766 | | |
| | | 767 | | public void SetColor(int row, int columnID, Color value) |
| | 0 | 768 | | { |
| | 0 | 769 | | SetCell(row, columnID, ref allColorColumns, value); |
| | 0 | 770 | | } |
| | | 771 | | |
| | | 772 | | public void SetLayerMask(int row, int columnID, LayerMask value) |
| | 0 | 773 | | { |
| | 0 | 774 | | SetCell(row, columnID, ref allLayerMaskColumns, value); |
| | 0 | 775 | | } |
| | | 776 | | |
| | | 777 | | public void SetBounds(int row, int columnID, Bounds value) |
| | 0 | 778 | | { |
| | 0 | 779 | | SetCell(row, columnID, ref allBoundsColumns, value); |
| | 0 | 780 | | } |
| | | 781 | | |
| | | 782 | | public void SetBoundsInt(int row, int columnID, BoundsInt value) |
| | 0 | 783 | | { |
| | 0 | 784 | | SetCell(row, columnID, ref allBoundsIntColumns, value); |
| | 0 | 785 | | } |
| | | 786 | | |
| | | 787 | | public void SetHash128(int row, int columnID, Hash128 value) |
| | 0 | 788 | | { |
| | 0 | 789 | | SetCell(row, columnID, ref allHash128Columns, value); |
| | 0 | 790 | | } |
| | | 791 | | |
| | | 792 | | public void SetGradient(int row, int columnID, Gradient value) |
| | 0 | 793 | | { |
| | 0 | 794 | | SetCell(row, columnID, ref allGradientColumns, value); |
| | 0 | 795 | | } |
| | | 796 | | |
| | | 797 | | public void SetAnimationCurve(int row, int columnID, AnimationCurve value) |
| | 0 | 798 | | { |
| | 0 | 799 | | SetCell(row, columnID, ref allAnimationCurveColumns, value); |
| | 0 | 800 | | } |
| | | 801 | | |
| | | 802 | | public void SetObject(int row, int columnID, UnityEngine.Object value) |
| | 0 | 803 | | { |
| | 0 | 804 | | SetCell(row, columnID, ref allObjectRefColumns, value); |
| | 0 | 805 | | } |
| | | 806 | | |
| | | 807 | | // Get |
| | | 808 | | |
| | | 809 | | public string GetString(int row, int columnID) |
| | 0 | 810 | | { |
| | 0 | 811 | | return GetCell(row, columnID, ref allStringColumns); |
| | 0 | 812 | | } |
| | | 813 | | |
| | | 814 | | public bool GetBool(int row, int columnID) |
| | 0 | 815 | | { |
| | 0 | 816 | | return GetCell(row, columnID, ref allBoolColumns); |
| | 0 | 817 | | } |
| | | 818 | | |
| | | 819 | | public char GetChar(int row, int columnID) |
| | 0 | 820 | | { |
| | 0 | 821 | | return GetCell(row, columnID, ref allCharColumns); |
| | 0 | 822 | | } |
| | | 823 | | |
| | | 824 | | public sbyte GetSbyte(int row, int columnID) |
| | 0 | 825 | | { |
| | 0 | 826 | | return GetCell(row, columnID, ref allSbyteColumns); |
| | 0 | 827 | | } |
| | | 828 | | |
| | | 829 | | public byte GetByte(int row, int columnID) |
| | 0 | 830 | | { |
| | 0 | 831 | | return GetCell(row, columnID, ref allByteColumns); |
| | 0 | 832 | | } |
| | | 833 | | |
| | | 834 | | public short GetShort(int row, int columnID) |
| | 0 | 835 | | { |
| | 0 | 836 | | return GetCell(row, columnID, ref allShortColumns); |
| | 0 | 837 | | } |
| | | 838 | | |
| | | 839 | | public ushort GetUshort(int row, int columnID) |
| | 0 | 840 | | { |
| | 0 | 841 | | return GetCell(row, columnID, ref allUshortColumns); |
| | 0 | 842 | | } |
| | | 843 | | |
| | | 844 | | public int GetInt(int row, int columnID) |
| | 0 | 845 | | { |
| | 0 | 846 | | return GetCell(row, columnID, ref allIntColumns); |
| | 0 | 847 | | } |
| | | 848 | | |
| | | 849 | | public uint GetUint(int row, int columnID) |
| | 0 | 850 | | { |
| | 0 | 851 | | return GetCell(row, columnID, ref allUintColumns); |
| | 0 | 852 | | } |
| | | 853 | | |
| | | 854 | | public long GetLong(int row, int columnID) |
| | 0 | 855 | | { |
| | 0 | 856 | | return GetCell(row, columnID, ref allLongColumns); |
| | 0 | 857 | | } |
| | | 858 | | |
| | | 859 | | public ulong GetUlong(int row, int columnID) |
| | 0 | 860 | | { |
| | 0 | 861 | | return GetCell(row, columnID, ref allUlongColumns); |
| | 0 | 862 | | } |
| | | 863 | | |
| | | 864 | | public float GetFloat(int row, int columnID) |
| | 0 | 865 | | { |
| | 0 | 866 | | return GetCell(row, columnID, ref allFloatColumns); |
| | 0 | 867 | | } |
| | | 868 | | |
| | | 869 | | public double GetDouble(int row, int columnID) |
| | 0 | 870 | | { |
| | 0 | 871 | | return GetCell(row, columnID, ref allDoubleColumns); |
| | 0 | 872 | | } |
| | | 873 | | |
| | | 874 | | public Vector2 GetVector2(int row, int columnID) |
| | 0 | 875 | | { |
| | 0 | 876 | | return GetCell(row, columnID, ref allVector2Columns); |
| | 0 | 877 | | } |
| | | 878 | | |
| | | 879 | | public Vector3 GetVector3(int row, int columnID) |
| | 0 | 880 | | { |
| | 0 | 881 | | return GetCell(row, columnID, ref allVector3Columns); |
| | 0 | 882 | | } |
| | | 883 | | |
| | | 884 | | public Vector4 GetVector4(int row, int columnID) |
| | 0 | 885 | | { |
| | 0 | 886 | | return GetCell(row, columnID, ref allVector4Columns); |
| | 0 | 887 | | } |
| | | 888 | | |
| | | 889 | | public Vector2Int GetVector2Int(int row, int columnID) |
| | 0 | 890 | | { |
| | 0 | 891 | | return GetCell(row, columnID, ref allVector2IntColumns); |
| | 0 | 892 | | } |
| | | 893 | | |
| | | 894 | | public Vector3Int GetVector3Int(int row, int columnID) |
| | 0 | 895 | | { |
| | 0 | 896 | | return GetCell(row, columnID, ref allVector3IntColumns); |
| | 0 | 897 | | } |
| | | 898 | | |
| | | 899 | | public Quaternion GetQuaternion(int row, int columnID) |
| | 0 | 900 | | { |
| | 0 | 901 | | return GetCell(row, columnID, ref allQuaternionColumns); |
| | 0 | 902 | | } |
| | | 903 | | |
| | | 904 | | public Rect GetRect(int row, int columnID) |
| | 0 | 905 | | { |
| | 0 | 906 | | return GetCell(row, columnID, ref allRectColumns); |
| | 0 | 907 | | } |
| | | 908 | | |
| | | 909 | | public RectInt GetRectInt(int row, int columnID) |
| | 0 | 910 | | { |
| | 0 | 911 | | return GetCell(row, columnID, ref allRectIntColumns); |
| | 0 | 912 | | } |
| | | 913 | | |
| | | 914 | | public Color GetColor(int row, int columnID) |
| | 0 | 915 | | { |
| | 0 | 916 | | return GetCell(row, columnID, ref allColorColumns); |
| | 0 | 917 | | } |
| | | 918 | | |
| | | 919 | | public LayerMask GetLayerMask(int row, int columnID) |
| | 0 | 920 | | { |
| | 0 | 921 | | return GetCell(row, columnID, ref allLayerMaskColumns); |
| | 0 | 922 | | } |
| | | 923 | | |
| | | 924 | | public Bounds GetBounds(int row, int columnID) |
| | 0 | 925 | | { |
| | 0 | 926 | | return GetCell(row, columnID, ref allBoundsColumns); |
| | 0 | 927 | | } |
| | | 928 | | |
| | | 929 | | public BoundsInt GetBoundsInt(int row, int columnID) |
| | 0 | 930 | | { |
| | 0 | 931 | | return GetCell(row, columnID, ref allBoundsIntColumns); |
| | 0 | 932 | | } |
| | | 933 | | |
| | | 934 | | public Hash128 GetHash128(int row, int columnID) |
| | 0 | 935 | | { |
| | 0 | 936 | | return GetCell(row, columnID, ref allHash128Columns); |
| | 0 | 937 | | } |
| | | 938 | | |
| | | 939 | | public Gradient GetGradient(int row, int columnID) |
| | 0 | 940 | | { |
| | 0 | 941 | | return GetCell(row, columnID, ref allGradientColumns); |
| | 0 | 942 | | } |
| | | 943 | | |
| | | 944 | | public AnimationCurve GetAnimationCurve(int row, int columnID) |
| | 0 | 945 | | { |
| | 0 | 946 | | return GetCell(row, columnID, ref allAnimationCurveColumns); |
| | 0 | 947 | | } |
| | | 948 | | |
| | | 949 | | public UnityEngine.Object GetObject(int row, int columnID) |
| | 0 | 950 | | { |
| | 0 | 951 | | return GetCell(row, columnID, ref allObjectRefColumns); |
| | 0 | 952 | | } |
| | | 953 | | |
| | | 954 | | // Get ref |
| | | 955 | | |
| | | 956 | | public ref string GetStringRef(int row, int columnID) |
| | 0 | 957 | | { |
| | 0 | 958 | | return ref GetCellRef(row, columnID, ref allStringColumns); |
| | 0 | 959 | | } |
| | | 960 | | |
| | | 961 | | public ref bool GetBoolRef(int row, int columnID) |
| | 0 | 962 | | { |
| | 0 | 963 | | return ref GetCellRef(row, columnID, ref allBoolColumns); |
| | 0 | 964 | | } |
| | | 965 | | |
| | | 966 | | public ref char GetCharRef(int row, int columnID) |
| | 0 | 967 | | { |
| | 0 | 968 | | return ref GetCellRef(row, columnID, ref allCharColumns); |
| | 0 | 969 | | } |
| | | 970 | | |
| | | 971 | | public ref sbyte GetSbyteRef(int row, int columnID) |
| | 0 | 972 | | { |
| | 0 | 973 | | return ref GetCellRef(row, columnID, ref allSbyteColumns); |
| | 0 | 974 | | } |
| | | 975 | | |
| | | 976 | | public ref byte GetByteRef(int row, int columnID) |
| | 0 | 977 | | { |
| | 0 | 978 | | return ref GetCellRef(row, columnID, ref allByteColumns); |
| | 0 | 979 | | } |
| | | 980 | | |
| | | 981 | | public ref short GetShortRef(int row, int columnID) |
| | 0 | 982 | | { |
| | 0 | 983 | | return ref GetCellRef(row, columnID, ref allShortColumns); |
| | 0 | 984 | | } |
| | | 985 | | |
| | | 986 | | public ref ushort GetUshortRef(int row, int columnID) |
| | 0 | 987 | | { |
| | 0 | 988 | | return ref GetCellRef(row, columnID, ref allUshortColumns); |
| | 0 | 989 | | } |
| | | 990 | | |
| | | 991 | | public ref int GetIntRef(int row, int columnID) |
| | 0 | 992 | | { |
| | 0 | 993 | | return ref GetCellRef(row, columnID, ref allIntColumns); |
| | 0 | 994 | | } |
| | | 995 | | |
| | | 996 | | public ref uint GetUintRef(int row, int columnID) |
| | 0 | 997 | | { |
| | 0 | 998 | | return ref GetCellRef(row, columnID, ref allUintColumns); |
| | 0 | 999 | | } |
| | | 1000 | | |
| | | 1001 | | public ref long GetLongRef(int row, int columnID) |
| | 0 | 1002 | | { |
| | 0 | 1003 | | return ref GetCellRef(row, columnID, ref allLongColumns); |
| | 0 | 1004 | | } |
| | | 1005 | | |
| | | 1006 | | public ref ulong GetUlongRef(int row, int columnID) |
| | 0 | 1007 | | { |
| | 0 | 1008 | | return ref GetCellRef(row, columnID, ref allUlongColumns); |
| | 0 | 1009 | | } |
| | | 1010 | | |
| | | 1011 | | public ref float GetFloatRef(int row, int columnID) |
| | 0 | 1012 | | { |
| | 0 | 1013 | | return ref GetCellRef(row, columnID, ref allFloatColumns); |
| | 0 | 1014 | | } |
| | | 1015 | | |
| | | 1016 | | public ref double GetDoubleRef(int row, int columnID) |
| | 0 | 1017 | | { |
| | 0 | 1018 | | return ref GetCellRef(row, columnID, ref allDoubleColumns); |
| | 0 | 1019 | | } |
| | | 1020 | | |
| | | 1021 | | public ref Vector2 GetVector2Ref(int row, int columnID) |
| | 0 | 1022 | | { |
| | 0 | 1023 | | return ref GetCellRef(row, columnID, ref allVector2Columns); |
| | 0 | 1024 | | } |
| | | 1025 | | |
| | | 1026 | | public ref Vector3 GetVector3Ref(int row, int columnID) |
| | 0 | 1027 | | { |
| | 0 | 1028 | | return ref GetCellRef(row, columnID, ref allVector3Columns); |
| | 0 | 1029 | | } |
| | | 1030 | | |
| | | 1031 | | public ref Vector4 GetVector4Ref(int row, int columnID) |
| | 0 | 1032 | | { |
| | 0 | 1033 | | return ref GetCellRef(row, columnID, ref allVector4Columns); |
| | 0 | 1034 | | } |
| | | 1035 | | |
| | | 1036 | | public ref Vector2Int GetVector2IntRef(int row, int columnID) |
| | 0 | 1037 | | { |
| | 0 | 1038 | | return ref GetCellRef(row, columnID, ref allVector2IntColumns); |
| | 0 | 1039 | | } |
| | | 1040 | | |
| | | 1041 | | public ref Vector3Int GetVector3IntRef(int row, int columnID) |
| | 0 | 1042 | | { |
| | 0 | 1043 | | return ref GetCellRef(row, columnID, ref allVector3IntColumns); |
| | 0 | 1044 | | } |
| | | 1045 | | |
| | | 1046 | | public ref Quaternion GetQuaternionRef(int row, int columnID) |
| | 0 | 1047 | | { |
| | 0 | 1048 | | return ref GetCellRef(row, columnID, ref allQuaternionColumns); |
| | 0 | 1049 | | } |
| | | 1050 | | |
| | | 1051 | | public ref Rect GetRectRef(int row, int columnID) |
| | 0 | 1052 | | { |
| | 0 | 1053 | | return ref GetCellRef(row, columnID, ref allRectColumns); |
| | 0 | 1054 | | } |
| | | 1055 | | |
| | | 1056 | | public ref RectInt GetRectIntRef(int row, int columnID) |
| | 0 | 1057 | | { |
| | 0 | 1058 | | return ref GetCellRef(row, columnID, ref allRectIntColumns); |
| | 0 | 1059 | | } |
| | | 1060 | | |
| | | 1061 | | public ref Color GetColorRef(int row, int columnID) |
| | 0 | 1062 | | { |
| | 0 | 1063 | | return ref GetCellRef(row, columnID, ref allColorColumns); |
| | 0 | 1064 | | } |
| | | 1065 | | |
| | | 1066 | | public ref LayerMask GetLayerMaskRef(int row, int columnID) |
| | 0 | 1067 | | { |
| | 0 | 1068 | | return ref GetCellRef(row, columnID, ref allLayerMaskColumns); |
| | 0 | 1069 | | } |
| | | 1070 | | |
| | | 1071 | | public ref Bounds GetBoundsRef(int row, int columnID) |
| | 0 | 1072 | | { |
| | 0 | 1073 | | return ref GetCellRef(row, columnID, ref allBoundsColumns); |
| | 0 | 1074 | | } |
| | | 1075 | | |
| | | 1076 | | public ref BoundsInt GetBoundsIntRef(int row, int columnID) |
| | 0 | 1077 | | { |
| | 0 | 1078 | | return ref GetCellRef(row, columnID, ref allBoundsIntColumns); |
| | 0 | 1079 | | } |
| | | 1080 | | |
| | | 1081 | | public ref Hash128 GetHash128Ref(int row, int columnID) |
| | 0 | 1082 | | { |
| | 0 | 1083 | | return ref GetCellRef(row, columnID, ref allHash128Columns); |
| | 0 | 1084 | | } |
| | | 1085 | | |
| | | 1086 | | public ref Gradient GetGradientRef(int row, int columnID) |
| | 0 | 1087 | | { |
| | 0 | 1088 | | return ref GetCellRef(row, columnID, ref allGradientColumns); |
| | 0 | 1089 | | } |
| | | 1090 | | |
| | | 1091 | | public ref AnimationCurve GetAnimationCurveRef(int row, int columnID) |
| | 0 | 1092 | | { |
| | 0 | 1093 | | return ref GetCellRef(row, columnID, ref allAnimationCurveColumns); |
| | 0 | 1094 | | } |
| | | 1095 | | |
| | | 1096 | | public ref UnityEngine.Object GetObjectRef(int row, int columnID) |
| | 0 | 1097 | | { |
| | 0 | 1098 | | return ref GetCellRef(row, columnID, ref allObjectRefColumns); |
| | 0 | 1099 | | } |
| | | 1100 | | |
| | | 1101 | | // Get Column |
| | | 1102 | | |
| | | 1103 | | public string[] GetStringColumn(int columnID) |
| | 0 | 1104 | | { |
| | 0 | 1105 | | return GetColumn(columnID, ref allStringColumns); |
| | 0 | 1106 | | } |
| | | 1107 | | |
| | | 1108 | | public bool[] GetBoolColumn(int columnID) |
| | 0 | 1109 | | { |
| | 0 | 1110 | | return GetColumn(columnID, ref allBoolColumns); |
| | 0 | 1111 | | } |
| | | 1112 | | |
| | | 1113 | | public char[] GetCharColumn(int columnID) |
| | 0 | 1114 | | { |
| | 0 | 1115 | | return GetColumn(columnID, ref allCharColumns); |
| | 0 | 1116 | | } |
| | | 1117 | | |
| | | 1118 | | public sbyte[] GetSbyteColumn(int columnID) |
| | 0 | 1119 | | { |
| | 0 | 1120 | | return GetColumn(columnID, ref allSbyteColumns); |
| | 0 | 1121 | | } |
| | | 1122 | | |
| | | 1123 | | public byte[] GetByteColumn(int columnID) |
| | 0 | 1124 | | { |
| | 0 | 1125 | | return GetColumn(columnID, ref allByteColumns); |
| | 0 | 1126 | | } |
| | | 1127 | | |
| | | 1128 | | public short[] GetShortColumn(int columnID) |
| | 0 | 1129 | | { |
| | 0 | 1130 | | return GetColumn(columnID, ref allShortColumns); |
| | 0 | 1131 | | } |
| | | 1132 | | |
| | | 1133 | | public ushort[] GetUshortColumn(int columnID) |
| | 0 | 1134 | | { |
| | 0 | 1135 | | return GetColumn(columnID, ref allUshortColumns); |
| | 0 | 1136 | | } |
| | | 1137 | | |
| | | 1138 | | public int[] GetIntColumn(int columnID) |
| | 0 | 1139 | | { |
| | 0 | 1140 | | return GetColumn(columnID, ref allIntColumns); |
| | 0 | 1141 | | } |
| | | 1142 | | |
| | | 1143 | | public uint[] GetUintColumn(int columnID) |
| | 0 | 1144 | | { |
| | 0 | 1145 | | return GetColumn(columnID, ref allUintColumns); |
| | 0 | 1146 | | } |
| | | 1147 | | |
| | | 1148 | | public long[] GetLongColumn(int columnID) |
| | 0 | 1149 | | { |
| | 0 | 1150 | | return GetColumn(columnID, ref allLongColumns); |
| | 0 | 1151 | | } |
| | | 1152 | | |
| | | 1153 | | public ulong[] GetUlongColumn(int columnID) |
| | 0 | 1154 | | { |
| | 0 | 1155 | | return GetColumn(columnID, ref allUlongColumns); |
| | 0 | 1156 | | } |
| | | 1157 | | |
| | | 1158 | | public float[] GetFloatColumn(int columnID) |
| | 0 | 1159 | | { |
| | 0 | 1160 | | return GetColumn(columnID, ref allFloatColumns); |
| | 0 | 1161 | | } |
| | | 1162 | | |
| | | 1163 | | public double[] GetDoubleColumn(int columnID) |
| | 0 | 1164 | | { |
| | 0 | 1165 | | return GetColumn(columnID, ref allDoubleColumns); |
| | 0 | 1166 | | } |
| | | 1167 | | |
| | | 1168 | | public Vector2[] GetVector2Column(int columnID) |
| | 0 | 1169 | | { |
| | 0 | 1170 | | return GetColumn(columnID, ref allVector2Columns); |
| | 0 | 1171 | | } |
| | | 1172 | | |
| | | 1173 | | public Vector3[] GetVector3Column(int columnID) |
| | 0 | 1174 | | { |
| | 0 | 1175 | | return GetColumn(columnID, ref allVector3Columns); |
| | 0 | 1176 | | } |
| | | 1177 | | |
| | | 1178 | | public Vector4[] GetVector4Column(int columnID) |
| | 0 | 1179 | | { |
| | 0 | 1180 | | return GetColumn(columnID, ref allVector4Columns); |
| | 0 | 1181 | | } |
| | | 1182 | | |
| | | 1183 | | public Vector2Int[] GetVector2IntColumn(int columnID) |
| | 0 | 1184 | | { |
| | 0 | 1185 | | return GetColumn(columnID, ref allVector2IntColumns); |
| | 0 | 1186 | | } |
| | | 1187 | | |
| | | 1188 | | public Vector3Int[] GetVector3IntColumn(int columnID) |
| | 0 | 1189 | | { |
| | 0 | 1190 | | return GetColumn(columnID, ref allVector3IntColumns); |
| | 0 | 1191 | | } |
| | | 1192 | | |
| | | 1193 | | public Quaternion[] GetQuaternionColumn(int columnID) |
| | 0 | 1194 | | { |
| | 0 | 1195 | | return GetColumn(columnID, ref allQuaternionColumns); |
| | 0 | 1196 | | } |
| | | 1197 | | |
| | | 1198 | | public Rect[] GetRectColumn(int columnID) |
| | 0 | 1199 | | { |
| | 0 | 1200 | | return GetColumn(columnID, ref allRectColumns); |
| | 0 | 1201 | | } |
| | | 1202 | | |
| | | 1203 | | public RectInt[] GetRectIntColumn(int columnID) |
| | 0 | 1204 | | { |
| | 0 | 1205 | | return GetColumn(columnID, ref allRectIntColumns); |
| | 0 | 1206 | | } |
| | | 1207 | | |
| | | 1208 | | public Color[] GetColorColumn(int columnID) |
| | 0 | 1209 | | { |
| | 0 | 1210 | | return GetColumn(columnID, ref allColorColumns); |
| | 0 | 1211 | | } |
| | | 1212 | | |
| | | 1213 | | public LayerMask[] GetLayerMaskColumn(int columnID) |
| | 0 | 1214 | | { |
| | 0 | 1215 | | return GetColumn(columnID, ref allLayerMaskColumns); |
| | 0 | 1216 | | } |
| | | 1217 | | |
| | | 1218 | | public Bounds[] GetBoundsColumn(int columnID) |
| | 0 | 1219 | | { |
| | 0 | 1220 | | return GetColumn(columnID, ref allBoundsColumns); |
| | 0 | 1221 | | } |
| | | 1222 | | |
| | | 1223 | | public BoundsInt[] GetBoundsIntColumn(int columnID) |
| | 0 | 1224 | | { |
| | 0 | 1225 | | return GetColumn(columnID, ref allBoundsIntColumns); |
| | 0 | 1226 | | } |
| | | 1227 | | |
| | | 1228 | | public Hash128[] GetHash128Column(int columnID) |
| | 0 | 1229 | | { |
| | 0 | 1230 | | return GetColumn(columnID, ref allHash128Columns); |
| | 0 | 1231 | | } |
| | | 1232 | | |
| | | 1233 | | public Gradient[] GetGradientColumn(int columnID) |
| | 0 | 1234 | | { |
| | 0 | 1235 | | return GetColumn(columnID, ref allGradientColumns); |
| | 0 | 1236 | | } |
| | | 1237 | | |
| | | 1238 | | public AnimationCurve[] GetAnimationCurveColumn(int columnID) |
| | 0 | 1239 | | { |
| | 0 | 1240 | | return GetColumn(columnID, ref allAnimationCurveColumns); |
| | 0 | 1241 | | } |
| | | 1242 | | |
| | | 1243 | | public UnityEngine.Object[] GetObjectColumn(int columnID) |
| | 0 | 1244 | | { |
| | 0 | 1245 | | return GetColumn(columnID, ref allObjectRefColumns); |
| | 0 | 1246 | | } |
| | | 1247 | | |
| | | 1248 | | // Internal |
| | | 1249 | | |
| | | 1250 | | internal int AddColumnInternal<T>(string columnName, ref ArrayHolder<T>[] allColumnsOfType, ColumnType typeIndex |
| | 0 | 1251 | | { |
| | 0 | 1252 | | int columnCount = allColumnsOfType?.Length ?? 0; |
| | 0 | 1253 | | Array.Resize(ref allColumnsOfType, columnCount + 1); |
| | 0 | 1254 | | allColumnsOfType[columnCount].TArray = new T[rowCount]; |
| | | 1255 | | |
| | 0 | 1256 | | string[] columnNamesForType = allColumnNames[(int)typeIndex].TArray; |
| | 0 | 1257 | | int columnNamesCount = columnNamesForType?.Length ?? 0; |
| | 0 | 1258 | | Array.Resize(ref columnNamesForType, columnNamesCount + 1); |
| | 0 | 1259 | | columnNamesForType[columnNamesCount] = columnName; |
| | 0 | 1260 | | allColumnNames[(int)typeIndex].TArray = columnNamesForType; |
| | | 1261 | | |
| | 0 | 1262 | | int columnIndex = columnEntriesFreeListHead; |
| | 0 | 1263 | | int columnIDToDenseIndexMapLength = columnIDToDenseIndexMap?.Length ?? 0; |
| | 0 | 1264 | | if (columnIndex >= columnIDToDenseIndexMapLength) |
| | 0 | 1265 | | { |
| | 0 | 1266 | | int newSize = columnIndex * 2; |
| | 0 | 1267 | | newSize = newSize == 0 ? 1 : newSize; |
| | 0 | 1268 | | Array.Resize(ref columnIDToDenseIndexMap, newSize); |
| | 0 | 1269 | | for (int i = 0; i < columnIndex; i++) |
| | 0 | 1270 | | { |
| | 0 | 1271 | | ref ColumnEntryInternal entry = ref columnIDToDenseIndexMap[columnIndex + i]; |
| | 0 | 1272 | | entry.columnDenseIndex = columnIndex + i + 1; |
| | 0 | 1273 | | entry.columnType = ColumnType.Invalid; |
| | 0 | 1274 | | } |
| | 0 | 1275 | | } |
| | | 1276 | | |
| | 0 | 1277 | | ref int[] denseIndexToIDMap = ref columnDenseIndexToIDMap[(int)typeIndex].TArray; |
| | 0 | 1278 | | int denseIndexToIDMapLength = denseIndexToIDMap?.Length ?? 0; |
| | 0 | 1279 | | Array.Resize(ref denseIndexToIDMap, denseIndexToIDMapLength + 1); |
| | 0 | 1280 | | denseIndexToIDMap[denseIndexToIDMapLength] = columnIndex; |
| | | 1281 | | |
| | 0 | 1282 | | ref ColumnEntryInternal newEntryInternal = ref columnIDToDenseIndexMap[columnIndex]; |
| | 0 | 1283 | | newEntryInternal.columnDenseIndex = denseIndexToIDMapLength; |
| | 0 | 1284 | | newEntryInternal.columnType = typeIndex; |
| | | 1285 | | |
| | 0 | 1286 | | insertAt = insertAt < 0 ? combinedColumnCount : insertAt; |
| | 0 | 1287 | | ref int[] columnOrdersOfType = ref allColumnOrders[(int)typeIndex].TArray; |
| | 0 | 1288 | | int columnOrdersOfTypeLength = columnOrdersOfType?.Length ?? 0; |
| | 0 | 1289 | | Array.Resize(ref columnOrdersOfType, columnOrdersOfTypeLength + 1); |
| | 0 | 1290 | | columnOrdersOfType[columnOrdersOfTypeLength] = insertAt; |
| | | 1291 | | |
| | 0 | 1292 | | for (int i = 0; i < (int)ColumnType.Count; i++) |
| | 0 | 1293 | | { |
| | 0 | 1294 | | int[] columnOrdersOfTypeCurrent = allColumnOrders[i].TArray; |
| | 0 | 1295 | | int columnOrdersLength = columnOrdersOfTypeCurrent?.Length ?? 0; |
| | 0 | 1296 | | for (int j = 0; j < columnOrdersLength; j++) |
| | 0 | 1297 | | { |
| | 0 | 1298 | | int columnOrderCurrent = columnOrdersOfTypeCurrent[j]; |
| | | 1299 | | |
| | 0 | 1300 | | if (columnOrderCurrent > insertAt) |
| | 0 | 1301 | | { |
| | 0 | 1302 | | columnOrdersOfType[j] = columnOrderCurrent + 1; |
| | 0 | 1303 | | } |
| | 0 | 1304 | | } |
| | 0 | 1305 | | } |
| | | 1306 | | |
| | 0 | 1307 | | ++combinedColumnCount; |
| | 0 | 1308 | | dataVersion++; |
| | | 1309 | | |
| | 0 | 1310 | | return columnIndex; |
| | 0 | 1311 | | } |
| | | 1312 | | |
| | | 1313 | | internal void RemoveColumnInternal<T>(ref ArrayHolder<T>[] allColumnsOfType, ColumnType typeIndex, int columnID) |
| | 0 | 1314 | | { |
| | 0 | 1315 | | int columnLocation = columnIDToDenseIndexMap[columnID].columnDenseIndex; |
| | | 1316 | | |
| | 0 | 1317 | | int lastIndex = allColumnsOfType.Length - 1; |
| | 0 | 1318 | | allColumnsOfType[columnLocation] = allColumnsOfType[lastIndex]; |
| | | 1319 | | // T[][] newColumnArray = new T[lastIndex][]; |
| | 0 | 1320 | | ArrayHolder<T>[] newColumnArray = new ArrayHolder<T>[lastIndex]; |
| | 0 | 1321 | | Array.Copy(allColumnsOfType, 0, newColumnArray, 0, lastIndex); |
| | 0 | 1322 | | allColumnsOfType = newColumnArray; |
| | | 1323 | | |
| | 0 | 1324 | | string[] columnNamesOfType = allColumnNames[(int)typeIndex].TArray; |
| | 0 | 1325 | | columnNamesOfType[columnLocation] = columnNamesOfType[lastIndex]; |
| | 0 | 1326 | | string[] newColumnNamesOfType = new string[lastIndex]; |
| | 0 | 1327 | | Array.Copy(columnNamesOfType, 0, newColumnNamesOfType, 0, lastIndex); |
| | 0 | 1328 | | allColumnNames[(int)typeIndex].TArray = newColumnNamesOfType; |
| | | 1329 | | |
| | 0 | 1330 | | int[] columnOrdersOfType = allColumnOrders[(int)typeIndex].TArray; |
| | 0 | 1331 | | int columnOrder = columnOrdersOfType[columnLocation]; |
| | 0 | 1332 | | columnOrdersOfType[columnLocation] = columnOrdersOfType[lastIndex]; |
| | 0 | 1333 | | int[] newColumnOrdersOfType = new int[lastIndex]; |
| | 0 | 1334 | | Array.Copy(columnOrdersOfType, 0, newColumnOrdersOfType, 0, lastIndex); |
| | 0 | 1335 | | allColumnOrders[(int)typeIndex].TArray = newColumnOrdersOfType; |
| | | 1336 | | |
| | 0 | 1337 | | int[] denseIndicesOfType = columnDenseIndexToIDMap[(int)typeIndex].TArray; |
| | 0 | 1338 | | int sparseIndexAt = denseIndicesOfType[columnLocation]; |
| | 0 | 1339 | | int sparseIndexToSwap = columnOrdersOfType[lastIndex]; |
| | 0 | 1340 | | ref ColumnEntryInternal sparseIndexToFree = ref columnIDToDenseIndexMap[sparseIndexAt]; |
| | 0 | 1341 | | sparseIndexToFree.columnType = ColumnType.Invalid; |
| | 0 | 1342 | | sparseIndexToFree.columnDenseIndex = columnEntriesFreeListHead; |
| | 0 | 1343 | | columnEntriesFreeListHead = sparseIndexAt; |
| | 0 | 1344 | | columnIDToDenseIndexMap[sparseIndexToSwap].columnDenseIndex = columnLocation; |
| | 0 | 1345 | | denseIndicesOfType[columnLocation] = sparseIndexToSwap; |
| | 0 | 1346 | | int[] newDenseIndicesOfType = new int[lastIndex]; |
| | 0 | 1347 | | Array.Copy(denseIndicesOfType, 0, newDenseIndicesOfType, 0, lastIndex); |
| | 0 | 1348 | | columnDenseIndexToIDMap[(int)typeIndex].TArray = newDenseIndicesOfType; |
| | | 1349 | | |
| | 0 | 1350 | | for (int i = 0; i < (int)ColumnType.Count; i++) |
| | 0 | 1351 | | { |
| | 0 | 1352 | | int[] columnOrdersOfTypeCurrent = allColumnOrders[i].TArray; |
| | | 1353 | | |
| | 0 | 1354 | | int columnOrdersLength = columnOrdersOfTypeCurrent.Length; |
| | 0 | 1355 | | for (int j = 0; j < columnOrdersLength; j++) |
| | 0 | 1356 | | { |
| | 0 | 1357 | | int columnOrderCurrent = columnOrdersOfTypeCurrent[j]; |
| | | 1358 | | |
| | 0 | 1359 | | if (columnOrderCurrent > columnOrder) |
| | 0 | 1360 | | { |
| | 0 | 1361 | | columnOrdersOfType[j] = columnOrderCurrent - 1; |
| | 0 | 1362 | | } |
| | 0 | 1363 | | } |
| | 0 | 1364 | | } |
| | | 1365 | | |
| | 0 | 1366 | | --combinedColumnCount; |
| | 0 | 1367 | | dataVersion++; |
| | 0 | 1368 | | } |
| | | 1369 | | |
| | | 1370 | | internal void InsertRowsOfTypeInternal<T>(ref ArrayHolder<T>[] allColumnsOfType, int insertAt, int numberOfNewRo |
| | 0 | 1371 | | { |
| | 0 | 1372 | | int columnCount = allColumnsOfType?.Length ?? 0; |
| | 0 | 1373 | | for (int i = 0; i < columnCount; i++) |
| | 0 | 1374 | | { |
| | 0 | 1375 | | ref T[] column = ref allColumnsOfType[i].TArray; |
| | 0 | 1376 | | int newRowCount = rowCount + numberOfNewRows; |
| | 0 | 1377 | | Array.Resize(ref column, newRowCount); |
| | 0 | 1378 | | for (int j = newRowCount - 1; j > insertAt + numberOfNewRows - 1; j--) |
| | 0 | 1379 | | { |
| | 0 | 1380 | | column[j] = column[j - numberOfNewRows]; |
| | 0 | 1381 | | } |
| | | 1382 | | |
| | 0 | 1383 | | for (int j = 0; j < numberOfNewRows; j++) |
| | 0 | 1384 | | { |
| | 0 | 1385 | | column[insertAt + i] = default; |
| | 0 | 1386 | | } |
| | 0 | 1387 | | } |
| | 0 | 1388 | | } |
| | | 1389 | | |
| | | 1390 | | internal void DeleteRowsOfTypeInternal<T>(ref ArrayHolder<T>[] allColumnsOfType, int removeAt, int numberOfRowsT |
| | 0 | 1391 | | { |
| | 0 | 1392 | | int columnCount = allColumnsOfType?.Length ?? 0; |
| | | 1393 | | |
| | 0 | 1394 | | for (int i = 0; i < columnCount; i++) |
| | 0 | 1395 | | { |
| | 0 | 1396 | | ref T[] column = ref allColumnsOfType[i].TArray; |
| | 0 | 1397 | | int newRowCount = rowCount - numberOfRowsToDelete; |
| | | 1398 | | |
| | 0 | 1399 | | for (int j = removeAt; j < rowCount - numberOfRowsToDelete; j++) |
| | 0 | 1400 | | { |
| | 0 | 1401 | | column[j] = column[j + numberOfRowsToDelete]; |
| | 0 | 1402 | | } |
| | | 1403 | | |
| | 0 | 1404 | | Array.Resize(ref column, newRowCount); |
| | 0 | 1405 | | } |
| | 0 | 1406 | | } |
| | | 1407 | | |
| | | 1408 | | internal ref T GetCellRef<T>(int row, int columnID, ref ArrayHolder<T>[] allColumnsOfType) |
| | 0 | 1409 | | { |
| | 0 | 1410 | | int column = columnIDToDenseIndexMap[columnID].columnDenseIndex; |
| | 0 | 1411 | | return ref allColumnsOfType[column][row]; |
| | 0 | 1412 | | } |
| | | 1413 | | |
| | | 1414 | | internal T GetCell<T>(int row, int columnID, ref ArrayHolder<T>[] allColumnsOfType) |
| | 0 | 1415 | | { |
| | 0 | 1416 | | int column = columnIDToDenseIndexMap[columnID].columnDenseIndex; |
| | 0 | 1417 | | return allColumnsOfType[column][row]; |
| | 0 | 1418 | | } |
| | | 1419 | | |
| | | 1420 | | internal void SetCell<T>(int row, int columnID, ref ArrayHolder<T>[] allColumnsOfType, T value) |
| | 0 | 1421 | | { |
| | 0 | 1422 | | int column = columnIDToDenseIndexMap[columnID].columnDenseIndex; |
| | 0 | 1423 | | allColumnsOfType[column][row] = value; |
| | 0 | 1424 | | dataVersion++; |
| | 0 | 1425 | | } |
| | | 1426 | | |
| | | 1427 | | internal T[] GetColumn<T>(int columnID, ref ArrayHolder<T>[] allColumnsOfType) |
| | 0 | 1428 | | { |
| | 0 | 1429 | | int column = columnIDToDenseIndexMap[columnID].columnDenseIndex; |
| | 0 | 1430 | | return allColumnsOfType[column].TArray; |
| | 0 | 1431 | | } |
| | | 1432 | | } |
| | | 1433 | | } |